export const state = () => {
  return {
    postArray: []
  };
};

export const mutations = {
  setPostArray(state,data){
    state.postArray = data;
  }
};

export const actions = {
  getArticleArrayByCityName({ commit },params){
    return new Promise((resolve, reject) => {
      this.$axios({
        url: '/posts',
        params: params
      }).then(res => {
        resolve(res);
        commit('setPostArray', res);
      })
    })
  }
}